3.4 \(\int \frac{\sin (x)}{i+\tan (x)} \, dx\)

Optimal. Leaf size=19 \[ \frac{\sin ^3(x)}{3}+\frac{1}{3} i \cos ^3(x) \]

[Out]

(I/3)*Cos[x]^3 + Sin[x]^3/3

________________________________________________________________________________________

Rubi [A]  time = 0.0893613, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.546, Rules used = {3518, 3108, 3107, 2565, 30, 2564} \[ \frac{\sin ^3(x)}{3}+\frac{1}{3} i \cos ^3(x) \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]/(I + Tan[x]),x]

[Out]

(I/3)*Cos[x]^3 + Sin[x]^3/3

Rule 3518

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[(Sin[e + f*x]
^m*(a*Cos[e + f*x] + b*Sin[e + f*x])^n)/Cos[e + f*x]^n, x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rule 3108

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_), x_Symbol] :> Dist[a^p*b^p, Int[(Cos[c + d*x]^m*Sin[c + d*x]^n)/(b*Cos[c + d*x] + a*Sin
[c + d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[a^2 + b^2, 0] && ILtQ[p, 0]

Rule 3107

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*sin[c + d*x]^n*(a*cos[c + d*x] + b*sin[c +
 d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IGtQ[p, 0]

Rule 2565

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[(a*f)^(-1), Subst[
Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2]
 &&  !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2564

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rubi steps

\begin{align*} \int \frac{\sin (x)}{i+\tan (x)} \, dx &=\int \frac{\cos (x) \sin (x)}{i \cos (x)+\sin (x)} \, dx\\ &=-(i \int \cos (x) (\cos (x)+i \sin (x)) \sin (x) \, dx)\\ &=-\left (i \int \left (\cos ^2(x) \sin (x)+i \cos (x) \sin ^2(x)\right ) \, dx\right )\\ &=-\left (i \int \cos ^2(x) \sin (x) \, dx\right )+\int \cos (x) \sin ^2(x) \, dx\\ &=i \operatorname{Subst}\left (\int x^2 \, dx,x,\cos (x)\right )+\operatorname{Subst}\left (\int x^2 \, dx,x,\sin (x)\right )\\ &=\frac{1}{3} i \cos ^3(x)+\frac{\sin ^3(x)}{3}\\ \end{align*}

Mathematica [A]  time = 0.01213, size = 33, normalized size = 1.74 \[ \frac{\sin (x)}{4}-\frac{1}{12} \sin (3 x)+\frac{1}{4} i \cos (x)+\frac{1}{12} i \cos (3 x) \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/(I + Tan[x]),x]

[Out]

(I/4)*Cos[x] + (I/12)*Cos[3*x] + Sin[x]/4 - Sin[3*x]/12

________________________________________________________________________________________

Maple [B]  time = 0.035, size = 47, normalized size = 2.5 \begin{align*}{\frac{1}{2} \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-1}}+{i \left ( \tan \left ({\frac{x}{2}} \right ) +i \right ) ^{-2}}+{\frac{2}{3} \left ( \tan \left ({\frac{x}{2}} \right ) +i \right ) ^{-3}}-{\frac{1}{2} \left ( \tan \left ({\frac{x}{2}} \right ) +i \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(I+tan(x)),x)

[Out]

1/2/(tan(1/2*x)-I)+I/(tan(1/2*x)+I)^2+2/3/(tan(1/2*x)+I)^3-1/2/(tan(1/2*x)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+tan(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.99361, size = 47, normalized size = 2.47 \begin{align*} \frac{1}{12} \,{\left (i \, e^{\left (4 i \, x\right )} + 3 i\right )} e^{\left (-i \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+tan(x)),x, algorithm="fricas")

[Out]

1/12*(I*e^(4*I*x) + 3*I)*e^(-I*x)

________________________________________________________________________________________

Sympy [A]  time = 0.17362, size = 17, normalized size = 0.89 \begin{align*} \frac{i e^{3 i x}}{12} + \frac{i e^{- i x}}{4} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+tan(x)),x)

[Out]

I*exp(3*I*x)/12 + I*exp(-I*x)/4

________________________________________________________________________________________

Giac [B]  time = 1.3401, size = 45, normalized size = 2.37 \begin{align*} -\frac{i}{2 \,{\left (-i \, \tan \left (\frac{1}{2} \, x\right ) - 1\right )}} - \frac{3 \, \tan \left (\frac{1}{2} \, x\right )^{2} - 1}{6 \,{\left (\tan \left (\frac{1}{2} \, x\right ) + i\right )}^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(I+tan(x)),x, algorithm="giac")

[Out]

-1/2*I/(-I*tan(1/2*x) - 1) - 1/6*(3*tan(1/2*x)^2 - 1)/(tan(1/2*x) + I)^3